// $("body").append(`<input id="autocomplete" title="type &quot;a&quot;">`);

import { objectview } from '@feng3d/objectview';
import { Element } from './components/UI';
export * from './ov';

//
objectview.defaultBaseObjectViewClass = 'OVBaseDefault';
objectview.defaultObjectViewClass = 'OVDefault';
objectview.defaultObjectAttributeViewClass = 'OAVDefault';
objectview.defaultObjectAttributeBlockView = 'OBVDefault';

objectview.setDefaultTypeAttributeView('Boolean', { component: 'OAVBoolean' });
objectview.setDefaultTypeAttributeView('number', { component: 'OAVNumber' });
objectview.setDefaultTypeAttributeView('Date', { component: 'OAVDatepicker' });

$('body').ready(() =>
{
    $('body').append(`<input id="autocomplete">`);
    // $("body").append(`<input id="autocomplete">`).ready(function ()
    // {
    const availableTags = [
        'ActionScript',
        'AppleScript',
        'Asp',
        'BASIC',
        'C',
        'C++',
        'Clojure',
        'COBOL',
        'ColdFusion',
        'Erlang',
        'Fortran',
        'Groovy',
        'Haskell',
        'Java',
        'JavaScript',
        'Lisp',
        'Perl',
        'PHP',
        'Python',
        'Ruby',
        'Scala',
        'Scheme'
    ];

    $('#autocomplete').autocomplete({
        source: availableTags
    });
    // });

    const stage = new Element(document.body);

    const data = globalThis.data = {
        a: 1, b: false, c: 'abcd',
        date: new Date(),
    };

    const view = objectview.getObjectView(data);
    // eslint-disable-next-line @typescript-eslint/ban-ts-comment
    // @ts-ignore
    stage.addChild(view);
});
